package com.goole.shape;

public class Triangle extends Shape {
    private double edge;

    public Triangle(String name, double edge) {
        super(name);
        this.edge = edge;
    }

    @Override
    public double getArea() {
        return Math.sqrt(3) / 4 * Math.pow(edge, 2);
    }

    @Override
    public double getPerimeter() {
        return 3 * edge;
    }
}
